
<div class="node-<?php print $node->nid; ?> clearfix">

  <div class="prod-cont">
  	<div class="prod-img">
  		<img src="<?php print file_create_url($node->uc_product_image['und'][0]['uri']); ?>" />
  	</div>
    <div class="prod-view">
    	<div class="prod-tilte">
      	<h1><?php print $title; ?></h1>
      </div>
      <div class="prod-sku prod-cont-item">
      	<h3><?php print $node->model; ?></h3>
      </div>
      <div class="prod-body prod-cont-item">
      	<?php print $node->body['und'][0]['safe_value']; ?>
      </div>
       <div class="prod-cont-item"><strong>使用方法:</strong><?php $field = field_get_items('node', $node, 'field_product_ff'); print $field[0]['value']; ?>
      </div>
       <div class="prod-stype prod-cont-item"><p><strong>肌肤类型: </strong>
      	<?php $field = field_get_items('node', $node, 'field_product_stype'); print $field[0]['value']; ?></p>
      </div>
      <div class="prod-cont-item"><strong>容量:</strong><?php $field = field_get_items('node', $node, 'field_product_rl'); print $field[0]['value']; ?>
      </div>
      <div class="prod-cont-item"><strong>价格:￥</strong><?php print number_format($node->price, 2, '.', ''); ?>
      </div>

      <div class="prod-cont-item"><strong>产品类型:</strong>
        <?php
          $type = field_get_items('node', $node, 'field_product_type');
          $link = array();
          foreach ($type as $key => $value) {

            $link[] = l($value['taxonomy_term']->name, 'classic-item/' . $value['taxonomy_term']->tid);
          }
          print $html = implode($link, ',');
        ?>
      </div>

      <div class="prod-cont-item"><strong>产品咨询:</strong>
        <?php
          $type = field_get_items('node', $node, 'field_product_zx');
          $link = array();
          foreach ($type as $key => $value) {

            $link[] = l($value['taxonomy_term']->name, 'classic-item/' . $value['taxonomy_term']->tid);
          }
          print $html = implode($link, ',');
        ?>
      </div>

      <div class="prod-cont-item">
      <a id="add_link" href="#"><img border="0" alt="添加到购物袋" src="<?php print base_path(); ?>sites/all/themes/aijia/images/spp-add-to-bag-btn.gif"></a>
      </div>
    </div>
    <div class="clearfix"></div>
	</div>

 	<div id="comment">

	<div id="comment-title">产品评级</div>

  <div id="wrapper" class="clearfix">

    <?php

		$build = array();
		$limit = 10;

		$total = db_select('comment', 'c')
			->condition('nid', $node->nid,'=')
			->fields('c', array('cid'))
			->execute()
			->rowCount();

		$query = db_select('comment', 'c')->extend('PagerDefault')->element(1);
		$query
			->fields('c', array('cid'))
			->condition('nid', $node->nid,'=')
  		->limit($limit);               // This line works, because the PagerDefault object is what is called.

		$cids = $query->execute()->fetchCol();

			$i = 0;
			$output = '';
			foreach ($cids as $cid) {
				$comment = comment_load($cid);
				$user = user_load($comment->uid);
				if($i == 0 || $i%$limit == 0){
					$output .='<div class="com-item com-item-first">';
				}elseif($i%$limit == $limit-1){
					$output .='<div class="com-item com-item-last">';
				}else{
					$output .='<div class="com-item">';
				}

      	$output .='<div class="com-item-left">';
      	$output .='<div class="com-item-title">'.$comment->subject.'</div>';
				$body = field_get_items('comment', $comment, 'comment_body');
        $output .='<div class="com-item-body">"'. $body[0]['value'] .'"</div>';
      	$output .='</div>';
				$output .='<div class="com-item-right">';

      	$output .='<div>'.$user->name.'</div>';
      	$output .='</div>';
      	$output .='<div class="clearfix"></div></div>';

				$i++;
			}

  		$output .=theme('pager', array('tags' => array(), 'limit' => $limit, 'element' => 1));

			print render($content['comments']);
		?>

  </div><!--wrapper-->
  </div><!--comment-->

</div><!-- /.node -->
